package com.carkeeper.service;

import com.carkeeper.dto.DepartmentDTO;
import com.carkeeper.service.serviceFallback.DepartmentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "carkeeper-operation", fallbackFactory = DepartmentFallbackFactory.class)
public interface DepartmentFeign {
    @GetMapping("/department/{id}")
    DepartmentDTO getDepartment(@PathVariable("id") Long id);
    @PostMapping("/department/list")
    List<DepartmentDTO> getByIds(@RequestBody List<Long> ids);
}
